<?php
/**
 *  Class voor het vergaren van gebruikersinfo
 */

function apache_note($var) {
	return getenv($var);
}

class GebruikersInfo {

	function ip(){// ip adres
	    if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))$TheIp=$_SERVER['HTTP_X_FORWARDED_FOR'];
	    else $TheIp=$_SERVER['REMOTE_ADDR'];
	    return trim($TheIp);
	}
	function stad(){ // geo city
		return apache_note('GEOIP_CITY');
	}
	function land(){// geo country
		return apache_note('GEOIP_COUNTRY_CODE');
	}
	function regio(){ // geo region
		return apache_note('GEOIP_REGION');
	}
	function dma(){	// geo dma
		return apache_note('GEOIP_DMA_CODE');
	}
	function buurt(){ // geo area
		return apache_note('GEOIP_AREA_CODE');
	}
	function breedtegraad(){ // geo latitude
		return apache_note('GEOIP_LATITUDE');
	}
	function lengtegraad(){ // geo longitude
		return apache_note('GEOIP_LONGITUDE');
	}
	function postcode(){ // geo postal code
		return apache_note('GEOIP_POSTAL_CODE');
	}
	function komt_van(){ // referer
		return $_SERVER['HTTP_REFERER'];
	}
	function zocht_op(){ // referer keywords
		$parse = parse_url($_SERVER['HTTP_REFERER']);
		$se = $parse["host"];
		$raw_var = explode("&", $parse["query"] );
		foreach ($raw_var as $one_var) {
   			 $raw = explode("=", $one_var);
   			 $var[$raw[0]] = urldecode ($raw[1]);
		}
		$se = explode (".", $se);
		switch ($se[1]) {
    		case 'yahoo':
        		$keywords = $var['p'];
        		break;
    		case 'aol':
        		$keywords = $var['query'];
        		break;
    		default:
        		$keywords = $var['q'];
		}
		unset($parse, $se, $raw_var, $one_var, $var);
		return $keywords;
	}
	function komt_van_domain(){ // referer domain
		return parse_url( htmlspecialchars( strip_tags( $_SERVER['HTTP_REFERER'] ) ) ); 
	}
	function taal(){ // language
		return $_SERVER['HTTP_ACCEPT_LANGUAGE'];
	}
	function huidige_pagina(){ // current page
		return $_SERVER['REQUEST_URI'];
	}
	function domainname(){ // domain name ip
		$ip = $_SERVER['HTTP_CLIENT_IP'];
		$visitor_host = @getHostByAddr( $ip );
		return $visitor_host;
	}
	function browser(){ // browser 
		$browser = get_browser(null, true);
		return $browser['browser'];
	}
	function browserversie(){ // browser version
		$browser = get_browser(null, true);
		return $browser['version'];
	}
	function browser_platform(){ // browser platform
		$browser = get_browser(null, true);
		return $browser['platform'];
	}
	function is_crawler(){ // is visitor a crawler
		$browser = get_browser(null, true);
		return $browser['crawler'];
	}
	function cssondersteuning(){ // css support
		$browser = get_browser(null, true);
		return $browser['css'];	
	}
	function cssversie(){ // css version
		$browser = get_browser(null, true);
		return $browser['cssversion'];	
	}
	function framesondersteuning(){ // frames support
		$browser = get_browser(null, true);
		return $browser['frames'];
	}
	function iframesondersteuning(){ // iframe supprot
		$browser = get_browser(null, true);
		return $browser['iframes'];
	}
	function tabelondersteuning(){ // tabel support
		$browser = get_browser(null, true);
		return $browser['tables'];
	}
	function cookieondersteuning(){ // cookie support
		$browser = get_browser(null, true);
		return $browser['cookies'];
	}
	function win32(){ // is win32
		$browser = get_browser(null, true);
		return $browser['win32'];	
	}
	function win64(){ // is win64
		$browser = get_browser(null, true);
		return $browser['win64'];	
	}
	function javaondersteuning(){ // java support
		$browser = get_browser(null, true);
		return $browser['javaapplets'];	
	}
	function javascriptondersteuning(){ // javascript support
		$browser = get_browser(null, true);
		return $browser['javascript'];	
	}
	function vbscriptondersteuning(){ //vbscript support
		$browser = get_browser(null, true);
		return $browser['vbscript'];	
	}
	function activexondersteuning(){ // activex support
		$browser = get_browser(null, true);
		return $browser['activexcontrols'];	
	}
	function is_rssreader(){ // is rss reader
		$browser = get_browser(null, true);
		return $browser['issyndicationreader'];	
	}
	function is_gsm(){ // is mobile device
		$browser = get_browser(null, true);
		return $browser['ismobiledevice'];	
	}
	function AnalyticsA(){ // analytics A cookie
		$content = $_COOKIE["__utma"];
		$content = explode(".",$content);
		return $content;
	}
	function AnalyticsB(){ // analytics B cookie
		$content = $_COOKIE["__utmb"];
		$content = explode(".",$content);
		return $content;
	}
	function AnalyticsC(){ // analytics C cookie
		$content = $_COOKIE["__utmc"];
		$content = explode(".",$content);
		return $content;
	}
	function AnalyticsZ(){ // analytics Z cookie
		$content = $_COOKIE["__utmz"];
		return $content;
	}
	function accept(){
		return $_SERVER['HTTP_ACCEPT'];
		}
	function accept_enc(){
		return $_SERVER['HTTP_ACCEPT_ENCODING'];
		}
	function accept_char(){
		return $_SERVER['HTTP_ACCEPT_CHARSET'];
		}
	function accept_lan(){
		return $_SERVER['HTTP_ACCEPT_LANGUAGE'];
		}
}
?>
